package com.princess.demok.ui.other

import android.annotation.SuppressLint
import com.princess.demok.R
import com.princess.demok.base.view.MyBaseActivity
import com.princess.demok.mvvm.view.HomeMvvmActivity
import com.princess.demok.ui.MainActivity
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import java.util.concurrent.TimeUnit

/**
 * @author: xha
 * @date: 2020/10/13 14:52
 * @Description:
 */
class LauncherActivity : MyBaseActivity() {
    override fun getLayoutId(): Int {
        return R.layout.activity_launcher
    }

    @SuppressLint("CheckResult")
    override fun initOnCreate() {
        showHeader(false)
        showTitle(false)

//        Observable.timer(2000, TimeUnit.MILLISECONDS)
//            .observeOn(AndroidSchedulers.mainThread())
//            .subscribe(Consumer {
//                MainActivity.start(this)
//            })

        launch {
            delay(2000)
            HomeMvvmActivity.start(this@LauncherActivity);
        }
    }
}

